# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-md2pdf
_pkgname=${pkgname#python-}
pkgver=1.0.1
pkgrel=1
pkgdesc='Python-based Markdown to PDF converter.'
arch=('any')
url='https://pypi.org/project/md2pdf'
license=('MIT')
depends=('python' 'python-weasyprint' 'python-docopt' 'python-markdown2')
makedepends=('python-setuptools' 'python-pip')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('6e86dabb235f35e572b08cf5fcec02b9e2afce70f63ce40e53b4222782a6245df00b75af0b17c6000651dddda66d4bb03a9a8b5350d82d9967aa36ec6af9d8bd')

prepare() {
  cd "$_pkgname-$pkgver"

  sed -i 's/find_packages()/find_packages(exclude=["tests*"])/g' setup.py
}

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

